﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DMC.Core.Models.Dto
{
    public class CommandTestDto
    {
        [JsonProperty("name")]
        public string Name { get; set; }
        [Required(ErrorMessage = "数据库提供者")]
        [JsonProperty("provider")]
        public string Provider { get; set; }

        [Required(ErrorMessage = "连接字符串必须填写")]
        [JsonProperty("connectionString")]
        public string ConnectionString { get; set; }

        [Required(ErrorMessage = "命令脚本必须填写")]
        [JsonProperty("commandText")]
        public string CommandText { get; set; }

        [Required(ErrorMessage = "请选择一个命令类型")]
        [JsonProperty("commandType")]
        public CommandType CommandType { get; set; }

        [Range(10, 500)]
        [JsonProperty("maxRowCount")]
        public int MaxRowCount { get; set; }

        [JsonProperty("parameters")]
        public List<CommandParameter> Parameters { get; set; }
    }
}
